from django.conf import settings
from django.conf.urls import patterns, include, url

import os
import re
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

jsDir = os.path.abspath(os.path.dirname(__file__).decode("utf-8"))
m = re.search(r'(?P<name>.*)/\w', jsDir)
myJsDir = m.group('name')

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'NApp.views.home', name='home'),
    # url(r'^NApp/', include('NApp.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    
    #url(r'^css/(?P<path>.*)$', 'django.views.static.serve', {'document_root': os.path.dirname(globals()["__file__"])+'/css'}),
    url(r'^js/(?P<path>.*)$', 'django.views.static.serve',{'document_root': os.path.join(myJsDir,'js')}),
    #url(r'^images/(?P</path><path>.*)$', 'django.views.static.serve', {'document_root': os.path.dirname(globals()["__file__"])+'/images'}),
		url(r'^polls/', include('polls.urls')),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^js/(?P<path>.*)$','django.views.static.serve',{'document_root':settings.STATIC_PATH}),
    url(r'^home/', include('home.urls') ),
    url(r'', include('home.urls') ),
    url(r'^regist/', include('regist.urls') ),
    url(r'^mysession/', include('mysession.urls') ),
    
)
